import { Controller, Delete, Param, ParseUUIDPipe, Post, Req, UseGuards } from '@nestjs/common';
import { ArticleCollectService } from './article-collect.service'
import { AuthGuard } from '../../guard/auth.guard'

@Controller('article/collect')
export class ArticleCollectController {
    constructor(
        private readonly articleCollectService: ArticleCollectService,
    ) { }

    @Post(':id')
    @UseGuards(AuthGuard)
    postArticleCollect(@Req() req, @Param('id', ParseUUIDPipe) article_id) {
        return this.articleCollectService.create(req.userId, article_id)
    }

    @Delete(":id")
    @UseGuards(AuthGuard)
    deleteArticleCollect(@Req() req, @Param('id', ParseUUIDPipe) article_id) {

        return this.articleCollectService.delete(req.userId, article_id)

    }

}
